
    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>实现熔断和降级的常见方案有哪些？ - 学习卡片</title>
      <style>
        body { font-family: sans-serif; background-color: #f0f8ff; color: #333; display: flex; flex-direction: column; align-items: center; padding: 50px 20px; }
        .header h1 { font-size: 32px; }
        .grid-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; width: 100%; max-width: 1200px; }
        .card-container { perspective: 1200px; cursor: pointer; height: 250px; }
        .card { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.7s; border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
        .card-container.flipped .card { transform: rotateY(180deg); }
        .card-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; display: flex; flex-direction: column; box-sizing: border-box; border-radius: 16px; background-color: #fff; padding: 24px; }
        .card-back { background-color: #f0fff4; transform: rotateY(180deg); justify-content: space-between; }
        .card-category { font-size: 14px; color: #0052d9; margin-bottom: 8px; font-weight: 500; }
        .card-question { font-size: 20px; font-weight: 500; flex-grow: 1; display: flex; align-items: center; justify-content: center; text-align: center; }
        .card-answer-wrapper { flex-grow: 1; overflow-y: auto; }
        .card-answer { font-size: 15px; line-height: 1.7; }
        .card-footer { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 16px; margin-top: 16px; }
        .card-source { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 12px; margin-top: 12px; }
      </style>
    </head>
    <body>
      <div class="header">
        <h1>实现熔断和降级的常见方案有哪些？ - 学习卡片</h1>
      </div>
      <div class="grid-container">
        
    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">Hystrix 提供了哪些核心功能来保证微服务系统的稳定性？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">Hystrix 提供了四大核心功能：1. 熔断器，监控服务健康状态并在出现问题时熔断；2. 降级，在服务调用失败或超时后自动回退到预定义逻辑；3. 隔离，通过线程隔离和信号量隔离来限制故障影响范围；4. 监控，提供实时监控和仪表板功能。</div>
          </div>
          <div class="card-source">来源: 1. Hystrix</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">特性</div>
          <div class="card-question">相较于 Hystrix，Resilience4j 作为其现代化替代方案，额外提供了哪些文档中提及的关键特性？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">特性</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">除了熔断和降级功能外，Resilience4j 还额外提供了重试机制（在调用失败时自动重试）、限流策略（控制请求流量）和缓存（缓存服务结果以减少后端负载）等关键特性。</div>
          </div>
          <div class="card-source">来源: 2. Resilience4j</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">阿里巴巴开源的 Sentinel 组件主要的设计关注点是什么？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">Sentinel 是一款流量控制组件，其主要的设计关注点是高可用和高性能。它通过熔断、降级、流量控制和实时监控等功能来实现这一目标。</div>
          </div>
          <div class="card-source">来源: 3. Sentinel</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">模式</div>
          <div class="card-question">Spring Cloud Circuit Breaker 的核心作用是什么？它与 Hystrix、Resilience4j 等库是什么关系？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">模式</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">Spring Cloud Circuit Breaker 的核心作用是提供一个统一的熔断器解决方案集合（抽象层），它本身不直接实现熔断逻辑。它通过与 Hystrix、Resilience4j、Sentinel 等具体的熔断器库集成来工作，允许开发者根据需求灵活选择和切换底层的实现方案。</div>
          </div>
          <div class="card-source">来源: 4. Spring Cloud Circuit Breaker</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">Nginx 作为反向代理服务器，是如何实现简单的熔断和降级功能的？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">Nginx 主要通过其代理和负载均衡配置来实现：1. 通过配置负载均衡和请求重试来实现简单的熔断逻辑；2. 通过配置故障转移（failover）和备用服务器来实现降级功能。</div>
          </div>
          <div class="card-source">来源: 5. Nginx</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">特性</div>
          <div class="card-question">在文档中介绍的几种熔断降级方案中，有哪些明确提到了支持“限流”功能？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">特性</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">文档中明确提到支持限流功能或策略的方案有三个：Resilience4j、Sentinel 和 Nginx。</div>
          </div>
          <div class="card-source">来源: 2. Resilience4j, 3. Sentinel, 5. Nginx</div>
        </div>
      </div>
    </div>

      </div>
    </body>
    </html>
